package com.skycity.auth.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author YingBo.Dai
 * @Date 2024/10/23
 * @Version 1.0
 */
@RestController
@RequestMapping("/oauth2")
@Slf4j
public class OauthController {

    @RequestMapping("/code")
    public String code(String code) {
//        Map<String,Object> map = new HashMap<>();
//        map.put("client_id","oidc-client");
//        map.put("client_secret","secret");
//        map.put("grant_type","authorization_code");
//        map.put("redirect_uri","http://127.0.0.1:7001/oauth2/code");
//        map.put("code",code);
//        String post = HttpUtil.post("http://127.0.0.1:7001/oauth2/token", map);
        log.info("{}",code);
        return code;
    }

    @GetMapping("/user")
    public String user() {
        return "user";
    }
}
